<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<h2 mat-dialog-title
    i18n>Scale a resource</h2>
<mat-dialog-content class="kd-dialog-text">
  <p i18n>
    {{data.displayName}} {{data.objectMeta.name}} will be updated to reflect the desired replicas count.
  </p>
  <mat-form-field class="kd-margin-right">
    <input [(ngModel)]="desired"
           name="desired"
           aria-label="Desired replicas"
           i18n-placeholder
           placeholder="Desired replicas"
           type="number"
           min="0"
           required
           matInput>
  </mat-form-field>
  <mat-form-field>
    <input [(ngModel)]="actual"
           [disabled]="true"
           name="actual"
           aria-label="Actual replicas"
           i18n-placeholder
           placeholder="Actual replicas"
           type="number"
           min="0"
           required
           matInput>
  </mat-form-field>
  <div class="kd-equivalent-block kd-muted kd-bg-card-dark"
       fxLayoutAlign=" center">
    <mat-icon>info</mat-icon>
    <div>
      <span i18n>This action is equivalent to:</span>
      <code>
        <ng-container>kubectl scale </ng-container>
        <ng-container *ngIf="data.objectMeta.namespace">-n {{data.objectMeta.namespace}} </ng-container>
        <ng-container>{{data.typeMeta.kind}} {{data.objectMeta.name}} --replicas={{desired}}</ng-container>
      </code>
    </div>
  </div>
</mat-dialog-content>
<mat-dialog-actions>
  <button mat-button
          color="primary"
          [mat-dialog-close]="desired"
          i18n>
    Scale
  </button>
  <button mat-button
          color="primary"
          [mat-dialog-close]="false"
          i18n>
    Cancel
  </button>
</mat-dialog-actions>
